Carbon


MenuTitleDrawingProcPtr

Header: Appearance.h Carbon status: Supported

Draws a menu title.

typedef void(* MenuTitleDrawingProcPtr) (
    const Rect *inBounds, 
    SInt16 inDepth, 
    Boolean inIsColorDevice, 
    SInt32 inUserData
);

You would declare your function like this if you were to name it MyMenuTitleDrawingCallback:

void MyMenuTitleDrawingCallback (
    const Rect *inBounds, 
    SInt16 inDepth, 
    Boolean inIsColorDevice, 
    SInt32 inUserData
);
inBounds

A pointer to a structure of type Rect. You are passed a rectangle specifying the dimensions and position in which you should draw your menu title content. Your menu title drawing function is called clipped to the rectangle in which you are allowed to draw your content; do not draw outside this region.

inDepth

A signed 16-bit integer. You are passed the bit depth (in bits per pixel) of the current graphics port.

inIsColorDevice

A value of type Boolean. You are passed true to indicate that you are drawing on a color device; inIsColorDevice is false for a monochrome device.

inUserData

You are passed data specifying how to draw the menu title content from the inTitleData parameter of DrawThemeMenuTitle.

DISCUSSION

At the time your menu title drawing function is called, the foreground text color and mode is already set to draw in the correct state (enabled, selected, disabled) and correct color for the theme. You do not need to set the color unless you have special drawing needs. If you do have special drawing needs, you should supply the inDepth value and the value of the inIsColorDevice parameter to the function IsThemeInColor to determine whether or not you should draw the menu title content in color.

Note that the Appearance Manager calls your MyMenuTitleDrawingCallback function for every device that the inBounds rectangle intersects.

You should refer to your MyMenuTitleDrawingCallback function using a MenuTitleDrawingUPP, which you can create with the NewMenuTitleDrawingProc macro.

You typically use the NewMenuTitleDrawingProc macro like this:

MenuTitleDrawingUPP myMenuTitleDrawingUPP;

myMenuTitleDrawingUPP = NewMenuTitleDrawingProc(MyMenuTitleDrawingCallback);

You typically use the CallMenuTitleDrawingProc macro like this:

CallMenuTitleDrawingProc(myMenuTitleDrawingUPP, inBounds, inDepth, inIsColorDevice, inUserData);

SPECIAL CONSIDERATIONS

The Appearance Manager draws the background of the menu title prior to calling your menu title drawing function, so you should not erase the title’s background from this function.

VERSION NOTES

This function is available with Appearance Manager 1.0.1 and later.

AVAILABILITY

Supported in Carbon.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)